package com.cvmars.jianyou.module.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cvmars.jianyou.R;
import com.cvmars.jianyou.model.UserInfoManager;
import com.cvmars.jianyou.module.base.BaseActivity;
import com.cvmars.jianyou.module.model.EventAppExit;
import com.cvmars.jianyou.utils.AlipayUtil;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity {

    @BindView(R.id.txt_setting_exit)
    TextView txtSettingExit;
    @BindView(R.id.txt_setting_password)
    TextView txtSettingPassword;
    @BindView(R.id.rl_advice)
    RelativeLayout rlAdvice;
    @BindView(R.id.rl_repassword)
    RelativeLayout rlRepassword;
    @BindView(R.id.rl_about)
    RelativeLayout rlAbout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
    }

    @OnClick()
    public void onViewClicked() {


    }

    @OnClick({R.id.txt_setting_password, R.id.rl_zhangzhu, R.id.txt_setting_exit, R.id.rl_advice, R.id.rl_repassword, R.id.rl_about})
    public void onViewClicked(View view) {
        switch (view.getId()) {

            case R.id.rl_repassword:

                startActivity(new Intent(this, ResetPassSetActivity.class));
                break;


            case R.id.rl_about:

                startActivity(new Intent(this, AboutActivity.class));
                break;

            case R.id.rl_zhangzhu:

                AlipayUtil.startAlipayClient(this);
                break;

            case R.id.txt_setting_password:

                startActivity(new Intent(this, ResetPassSetActivity.class));

                break;

            case R.id.rl_advice:

                startActivity(new Intent(this, AdviceActivity.class));
                break;


            case R.id.txt_setting_exit:
                //退出登录
                UserInfoManager.getInstance().onUserExit();
                startActivity(new Intent(this, LoginPassWordActivity.class));
                EventBus.getDefault().post(new EventAppExit(true));
                finish();
                break;
        }
    }


}
